#include <iostream>
#define MAX_LEN 100000

using namespace std;

// Recommend read:
// [Operator overloading]       https://www.runoob.com/cplusplus/cpp-overloading.html
// [Overload stream operator]   http://c.biancheng.net/cpp/biancheng/view/220.html
// [Usage of new and delete]    https://blog.csdn.net/hazir/article/details/21413833

class CSTRING
{
	public:
		char  *p = nullptr;

		CSTRING()
		{
			p = new char[MAX_LEN];
			p[0] = '\0';  // Let length = 0.
		}

		~CSTRING()
		{
			delete[] p;
		}

		char& operator[](int idx)
		{
			if (idx >= MAX_LEN)
			{
				return p[0];
			}
			return p[idx];
		}

		CSTRING& operator+=(CSTRING& target)
		{
			int idx = 0, idx_target = 0;
			for (; p[idx] != '\0'; idx += 1) {}
			p[idx] = '-';
			p[idx+1] = '-';
			idx += 2;
			for (; target.p[idx_target] != '\0'; idx_target += 1, idx += 1)
			{
				p[idx] = target.p[idx_target];
			}
			p[idx] = '\0';  // Note this. END OF STRING.
			// Above algorithm is equal to {strcat(p, (char*) "--"); strcat(p, target.p)}.
			return *this;
		}

		bool operator>(CSTRING& target)
		{
			int idx = 0;
			for (; p[idx] != '\0' && target.p[idx] != '\0'; idx += 1)
			{
				if (p[idx] > target.p[idx])
				{
					return true;
				}
				else if (p[idx] < target.p[idx])
				{
					return false;
				}
			}
			if (target.p[idx] == '\0' && p[idx] != '\0')
			{
				return true;
			}
			else
			{
				return false;
			}
		}

		CSTRING& operator=(CSTRING& target)
		{
			int idx = 0;
			for (; target.p[idx] != '\0'; idx += 1)
			{
				p[idx] = target.p[idx];
			}
			p[idx] = '\0';  // Note this. END OF STRING.
			// Above algorithm is equal to strcpy(p, target.p).
			return target;
		}
};

istream& operator>>(istream& input, CSTRING& target)
{
	input >> target.p;
	return input;
}

ostream& operator<<(ostream& output, CSTRING& target)
{
	output << target.p;
	return output;
}

int main()
{
	int n, i, j;

	while (cin >> n)  // Press CTRL + X, then press ENTER to exit.
	{
		CSTRING *c = new CSTRING[n+2];

		for (i = 0; i < n; i++)
		{
			cin >> c[i];
		}

		for (i = 0; i < n; i++)
		{
			for (j = 0; j < n - i - 1; j++)
			{
				if (c[j] > c[j+1])
				{
					c[n] = c[j];
					c[j] = c[j+1];
					c[j+1] = c[n];
				}
			}
		}

		for (i = 0; i < n; i++)
		{
			c[n+1] += c[i];
		}
		cout << c[n+1] << endl;
		delete[] c;
	}

	return 0;
}
